<script>
import panelModules from './overlap';

export default {
  name: 'TemplateModules',
  components: panelModules,
  props: {
    //模块类型
    types: {
      type: Array,
      default: () => [],
    },
    //模块选项
    options: {
      type: Object,
      default: () => {},
    },
  },
  render(createElement) {
    const components = this.types.map(res => {
      return createElement(res.type, {
        ref: res.type,
        style: {
          display: res.visible ? 'block' : 'none',
        },
        props: { ...this.options },
      });
    });
    return createElement('div', components);
  },
};
</script>
